package com.deyuanyun.pic.pbf.service;

import com.deyuanyun.pic.pbf.domain.*;
import com.deyuanyun.pic.settings.domain.base.Attachment;
import com.deyuanyun.pic.wf.domain.ProcessDefinition;

import java.util.List;
import java.util.Map;

/**
 * 非内检测维修记录业务层
 * @author lijun
 * @date 2016-06-25
 * 
 * History: [修改人][时间][修改描述]
 */
public interface ExternalRepairService {

    /**
     * 添加防腐层修复记录
     * @param coat 防腐层修复对象
     * @return 附件业务ID
     */
    public int repairCoatCreate(CoatRepair coat,String defectId,String[] att);
    /**
     * 添加复合材料补强修复记录
     * @param composites 复合材料补强修复对象
     * @return 附件业务ID
     */
    public int repairCompositesCreate(RepairComposites composites,String defectId,String[] att);
    /**
     * 添加钢质环氧套筒补强修复记录
     * @param epoxySleeve 钢质环氧套筒补强修复对象
     * @return 附件业务ID
     */
    public int repairEpoxySleeveCreate(RepairEpoxySleeve epoxySleeve,String defectId,String[] att);
    /**
     * 添加A，B型套筒补强修复记录
     * @param ABTypeSleeve A，B型套筒补强修复对象
     * @return 附件业务ID
     */
    public int repairABTypeSleeveCreate(RepairABTypeSleeve ABTypeSleeve,String defectId,String[] att);
    /**
     * 添加换管记录
     * @param replacePipe 换管对象
     * @return 附件业务ID
     */
    public int repairReplacePipeCreate(RepairReplacePipe replacePipe, String defectId, String[] imgsReplace,
                                       RepairPipeWelding repairPipeWelding, String imgsWelding[], List<RepairPipeWeld> repairPipeWeldList);
    /**
     * 添加换管焊接记录
     * @param repairPipeWelding  换管焊接对象
     * @return 焊接表ID
     */
    public String repairPipeWeldingCreate(RepairPipeWelding repairPipeWelding);
    /**
     * 添加换管焊缝记录
     * @param repairPipeWeld 换管焊缝对象
     * @return 受影响条数
     */
    public int repairPipeWeldCreate(RepairPipeWeld repairPipeWeld);
    /**
     * 添加其他修复记录
     * @param other 其他修复对象
     * @return 附件业务ID
     */
    public int repairOtherCreate(RepairOther other,String defectId,String[] att);
    /**
     * 通过缺陷ID查询防腐层修复信息
     * @param defectId  缺陷ID
     * @return
     */
    public CoatRepair queryRepairCoatByDefectId(String defectId);
    /**
     * 通过缺陷ID查询复合材料补强修复记录
     * @param defectId  缺陷ID
     * @return
     */
    public RepairComposites queryRepairCompositesByDefectId(String defectId);
    /**
     * 通过缺陷ID查询钢质环氧套筒补强修复记录
     * @param defectId  缺陷ID
     * @return
     */
    public RepairEpoxySleeve queryRepairEpoxySleeveByDefectId(String defectId);
    /**
     * 通过缺陷ID查询A，B型套筒补强修复记录
     * @param defectId  缺陷ID
     * @return
     */
    public RepairABTypeSleeve queryRepairABTypeSleeveByDefectId(String defectId);
    /**
     * 通过缺陷ID查询换管记录
     * @param defectId  缺陷ID
     * @return
     */
    public RepairReplacePipe queryRepairReplacePipeByDefectId(String defectId);
    /**
     * 通过换管ID查询焊接信息
     * @param replacePipeId 换管ID
     * @return 焊接信息
     */
    public RepairPipeWelding queryRepairPipeWeldingByReplacePipeId(String replacePipeId);
    /**
     * 通过缺陷ID查询换管焊接记录
     * @param weldingId  焊缝ID
     * @return
     */
    public List<RepairPipeWeld> queryRepairPipeWeldByWeldingId(String weldingId);
    /**
     * 通过缺陷ID查询其他修复记录
     * @param defectId  缺陷ID
     * @return
     */
    public RepairOtherVO queryRepairOtherByDefectId(String defectId);
    /**
     * 增加非内检缺陷和维修记录的对应数据
     */
    public int repairRcordAndDefectCreate(String defectId,String repairId);

    /**
     * 维修记录附件表和维修记录与非内检缺陷关系的创建
     * @return
     */
    public int createRcordAndAtt(String defectId,String repairId,String att[]);
    /**
     * 通过缺陷ID得到修复方法名
     */
    public ProcessDefinition queryRepairNameByDefectId(String defectId);
    /**
     * 查询修复记录附件
     */
    List<Attachment> queryAttachmentOrderByCustom(String businessId);

}
